﻿using Microsoft.Practices.Unity;
using Microsoft.Practices.Unity.InterceptionExtension;
using TSharp.Core.Aop.Handler;

namespace TSharp.Core.Aop.Attributes
{
	/// <summary>
	/// 缓存
	/// <para>2010/9/27</para>
	/// 	<para>TANGJINGBO</para>
	/// 	<author>tangjingbo</author>
	/// </summary>
	public class CacheAttribute : HandlerAttribute
	{
		/// <summary>
		/// Initializes a new instance of the <see cref="CacheAttribute"/> class.
		/// </summary>
		public CacheAttribute()
		{
			Order = 2;
		}

		/// <summary>
		/// Derived classes implement this method. When called, it
		/// creates a new call handler as specified in the attribute
		/// configuration.
		/// </summary>
		/// <param name="container">The <see cref="T:Microsoft.Practices.Unity.IUnityContainer"/> to use when creating handlers,
		/// if necessary.</param>
		/// <returns>A new call handler object.</returns>
		public override ICallHandler CreateHandler(IUnityContainer container)
		{
			return new CacheHandler(container);
		}
	}
}